fa7cb29a6176e5f910ae218ce1fb359171f5c90b,src/main/java/com/skin/ayada/web/TemplateDispatcher.java,TemplateDispatcher,create,#ServletConfig#,125

Before Change


        TemplateContextFactory contextFactory = new TemplateContextFactory();
        contextFactory.setHome(home);
        contextFactory.setSourcePattern(servletConfig.getInitParameter("sourcePattern"));
        contextFactory.setJspWork(servletConfig.getInitParameter("jspWork"));
        contextFactory.setZipFile(servletConfig.getInitParameter("zipFile"));
        contextFactory.setIgnoreJspTag(servletConfig.getInitParameter("ignoreJspTag"));
        contextFactory.setClassPath(servletConfig.getInitParameter("classPath"));

After Change


        String encoding = servletConfig.getInitParameter("encoding");
        String contentType = servletConfig.getInitParameter("contentType");
        String sourcePattern = servletConfig.getInitParameter("sourcePattern");
        String jspWork = servletConfig.getInitParameter("jspWork");
        String zipFile = servletConfig.getInitParameter("zipFile");
        ServletContext servletContext = servletConfig.getServletContext();

        if(home == null) {
            home = "contextPath:/";
        }

        if(home.startsWith("contextPath:")) {
            home = home.substring(12);
            home = servletContext.getRealPath(home);
        }

        if(jspWork != null && jspWork.startsWith("contextPath:")) {
            jspWork = jspWork.substring(12);
            jspWork = servletContext.getRealPath(jspWork);
        }

        if(zipFile != null && zipFile.startsWith("contextPath:")) {
            zipFile = zipFile.substring(12);
            zipFile = servletContext.getRealPath(zipFile);
        }

        if(prefix != null) {
            prefix = Path.getStrictPath(prefix);
        }

        if(encoding == null) {
            encoding = "UTF-8";
        }

        if(contentType == null) {
            contentType = "text/html; charset=UTF-8";
        }

        logger.info("name: {}", name);
        logger.info("page.home: {}", home);
        logger.info("page.work: {}", jspWork);
        logger.info("page.prefix: {}", prefix);
        logger.info("page.encoding: {}", encoding);
        logger.info("page.contentType: {}", contentType);